//
//  HYCPushAllCityCell.m
//  FamilyTravel
//
//  Created by dllo on 15/10/28.
//  Copyright (c) 2015年 蓝鸥科技. All rights reserved.
//

#import "HYCPushAllCityCell.h"
#import "HYCPushAllCityModel.h"
#import <UIImageView+WebCache.h>
#define WIDTH self.contentView.frame.size.width
#define HEIFGT self.contentView.frame.size.height
@implementation HYCPushAllCityCell
- (void)dealloc {
    [_cityImageView release];
    [_cnnameLabel release];
    [_ennamelabel release];
    
    [super dealloc];
}
- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        
        self.cityImageView = [[UIImageView alloc] initWithFrame:CGRectMake(5, 5, WIDTH / 1.1, HEIFGT / 1.2296)];
        [self.contentView addSubview:self.cityImageView];
        
        [_cityImageView release];
        
        self.cnnameLabel = [[UILabel alloc] initWithFrame:CGRectMake(WIDTH / 3.9, HEIFGT / 3.32, WIDTH / 2.228, HEIFGT / 6.64)];
        self.cnnameLabel.font = [UIFont systemFontOfSize:12];
        [self.contentView addSubview:self.cnnameLabel];
        [_cnnameLabel release];
        
        self.ennamelabel = [[UILabel alloc] initWithFrame:CGRectMake(WIDTH / 3.9, HEIFGT / 2.075, WIDTH / 2.228, HEIFGT / 8.3)];
        self.ennamelabel.font = [UIFont systemFontOfSize:12];
        [self.contentView addSubview:self.ennamelabel];
        [_ennamelabel release];
        
    }
    return self;
}

- (void)setModel:(HYCPushAllCityModel *)model {
    
    if (self.model != model) {
        [_model release];
        _model = [model retain];
        
        [_cityImageView sd_setImageWithURL:[NSURL URLWithString:_model.photo]placeholderImage:[UIImage imageNamed:@"zw.png"]];
        self.cnnameLabel.text = _model.catename;
        self.ennamelabel.text = _model.catename_en;
        
    }
    
}


@end
